alter table "InventoryProduct" drop column if exists "SupplierId",drop column if exists "MaxQuantity",
drop column if exists "MinQuantity", drop column if exists "ReorderLevelQuantity",drop column if exists "RackId",
drop column if exists "SaleUnit",drop column if exists "SaleUnitQuantity";


CREATE TABLE "InventoryDepartment" (
	"InventoryDepartmentId" serial primary key,
	"Name" varchar(300) NULL,
	"Active" bool NULL DEFAULT true,
	"CreatedBy" int4 NULL,
	"CreatedDate" timestamp NULL,
	"ModifiedBy" int4 NULL,
	"ModifiedDate" timestamp NULL,
	"LocationId" int4 NULL,
	CONSTRAINT "InventoryDepartment_CreatedBy_fkey" FOREIGN KEY ("CreatedBy") REFERENCES "Account"("AccountId"),
	CONSTRAINT "InventoryDepartment_LocationId_fkey" FOREIGN KEY ("LocationId") REFERENCES "Location"("LocationId"),
	CONSTRAINT "InventoryDepartment_ModifiedBy_fkey" FOREIGN KEY ("ModifiedBy") REFERENCES "Account"("AccountId")
);

CREATE TABLE "InventoryDepartmentUser" (
	"InventoryDepartmentUserId" serial4 NOT NULL,
	"InventoryDepartmentId" int4 NULL,
	"AccountId" int4 NULL,
	CONSTRAINT "InventoryDepartmentUser_pkey" PRIMARY KEY ("InventoryDepartmentUserId"),
	CONSTRAINT "InventoryDepartmentUser_InventoryDepartmentId_fkey" FOREIGN KEY ("InventoryDepartmentId") REFERENCES "InventoryDepartment"("InventoryDepartmentId")
);